<template>
  <personal />
  <div :class="{ fixedBox: isFixed }">
    <hot-article />
    <visitor />
  </div>
</template>

<script>
import Personal from "./Personal/index.vue";
import HotArticle from "./HotArticle/index.vue";
import Visitor from "./Visitor/index.vue";
export default {
  name: "AppAside",
  components: {
    Personal,
    HotArticle,
    Visitor,
  },
  data() {
    return {
      isFixed: false,
    };
  },
  methods: {
    scroll() {
      let top = document.documentElement.scrollTop;
      this.isFixed = top >= 235;
    },
  },
  mounted() {
    window.addEventListener("scroll", () => {
      this.scroll();
    });
  },
};
</script>

<style lang="less" scoped>
.fixedBox {
  position: fixed;
  top: 65px;
  width: 270px;
}
</style>